home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / dev / misc / FlexCat.lha / Lib / C++_CatalogF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-28  |  1.5 KB  |  41 lines

  1. ##rem $Id: C++_CatalogF.h,v 1.2 1999/11/28 03:36:41 carlos Exp $
  2.  
  3. #ifndef CATALOGF_H
  4. #define CATALOGF_H
  5. // Interface file
  6. // MUST be included in your code.
  7. // If you are using FlexCat, you only need to include the header
  8. // file generated by it.
  9. // The locale.library is opened whenever is needed ...
  10.  
  11. #include <exec/types.h>
  12.  
  13. extern struct LocaleBase* LocaleBase;
  14. // data-type that will be used to define the strings from the .cd file ...
  15. // so, you need (if you want hard code) a file with a set of structures
  16. // of this type, containing an identificator ID, and the string itself.
  17. // this way, you could use this class without FlexCat and Locale.library,
  18. // although i do not think WHY should you do that :)
  19. struct CatMessage {
  20.                     LONG   ID;
  21.                     STRPTR textstring;
  22.                   };
  23.  
  24. class CatalogF
  25. {
  26. public:
  27.     CatalogF( const STRPTR   catalogFileName,
  28.               const STRPTR   builtInLanguage ="english", // default
  29.               const LONG     versionNumber =0 ,          // match any
  30.               const STRPTR   languageName =0,            // use user defined
  31.               struct Locale* loc =0 );                   // user defined
  32.     const STRPTR GetStr(const CatMessage& mess) const;
  33.     ~CatalogF();
  34. private:
  35.     struct Catalog* thecatalog;
  36.     static unsigned counter;    // counter of opened objects
  37. //    static struct LocaleBase* LocaleBase; // we do not bother if other
  38.                                           // opened the library before
  39. };
  40. #endif  // CATALOGF_H
  41.